<?php
import('@.nbbc.nbbc','','.php');
class NoticeBBCode extends BBCode{
//重载size标签- 宣告失败

    public function NoticeBBCode(){
        parent::__construct();
        $this->AddRule(
            'size', Array(
            'mode' => BBCODE_MODE_LIBRARY,
            'allow' => Array('_default' => '/^[0-9.]+$/D'),
            'method' => 'DoSize',
            'class' => 'inline',
            'allow_in' => Array('listitem', 'block', 'columns', 'inline', 'link'),
            )
        );
    }
function DoSize($bbcode, $action, $name, $default, $params, $content) {
die;
    switch ($default) {
    case '0': $size = '0.5em'; break;
    default:
    case '1': $size = '1em'; break;
    case '2': $size = '1.5em'; break;
    case '3': $size = '2em'; break;
    case '4': $size = '2.5em'; break;
    case '5': $size = '3em'; break;
    case '6': $size = '3.5em'; break;
    case '7': $size = '4em'; break;
    }
    return "<span style=\"font-size:$size\">$content</span>";
}
}
?>